package com.mallcloud.mall.app.task.mm;

import com.mallcloud.mall.app.service.AppOrderCouponService;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;

/**
 * 美美【券订单】定时处理支付，需要超时回滚订单
 */
@Slf4j
@RequiredArgsConstructor
//@Configuration      //1.主要用于标记配置类，兼备Component的效果。
//@ConditionalOnProperty("const.wxpay.v2.appId")
public class CouponOrderNotifyJob {
    private final AppOrderCouponService appOrderCouponService;

    @SneakyThrows
    @Scheduled(cron = "0 0/5 * * * ?")
    private void xglPayTasks() {
        log.info("=========");
        log.info("=========");
        log.info("美美券订单补偿....");

		appOrderCouponService.handleTimeOut();
        log.info("券订单补偿结束");
    }
}